//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Globalization;
using System.Windows.Data;

namespace OpenLS.Spreadsheet
{
    public class DimensionIsSelectedConverter: IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool result;
            if (value is Column)
            {
                Column column = (Column)value;
                result = column.GetIsSelected();
            }
            else
            {
                Row r = (Row)value;
                result = r.GetIsSelected();
            }
            return result;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
        public static DimensionIsSelectedConverter Instance
        {
            get
            {
                return new DimensionIsSelectedConverter();
            }
        }


        #endregion
    }
}
